package com.gfhd.multithread.service;

public class ThreadDemo1 {
    public void test(){
        MyThread myThread = new MyThread("1号");
        //myThread.setName("1号");
        myThread.start();
        System.out.println(myThread.getName());
        for (int i = 0; i < 5; i++) {
            System.out.println("主线程执行输出："+i);
        }
        Thread m = Thread.currentThread();
        System.out.println(m.getName());

        MyThread myThread2 = new MyThread();
        System.out.println(myThread2.getName());
    }
}
